package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.InvocationTargetException;


@RestController
public class TestReloadController {

    @Autowired
    DynamicLoadController dynamicLoadController;

    @RequestMapping(value = "/t1")
    public String home1(String type) throws NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
        if (null == type) {
            return "type不能为空";
        }
        return dynamicLoadController.queryChannelByType(type).read();
    }

    @RequestMapping(value = "/t2")
    public String home2() throws NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
        return test;
    }

    @Value("${test.adb}")
    String test;

}
